package org.zjx.message;

import com.alibaba.fastjson2.annotation.JSONType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.Map;

@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@JSONType(typeName = "COMMAND")
public class CommandMessage extends Message {
    private String command;
    private Map<String, Object> params;

    public CommandMessage(String command) {
        this.command = command;
        setType(MessageType.COMMAND);
        setTimestamp(System.currentTimeMillis());
    }
}